<template>
	<a-modal v-model:visible="visible" width="992px" title="选择人员" @ok="handleConfirmSubmit">
		<UserSelect v-if="visible" v-model:value="selectedUsers" @select-user="handleSelectedUser" />
	</a-modal>
</template>

<script lang="ts" setup>
import { reactive } from 'vue';
const visible = defineModel();
const emit = defineEmits(['selected']);
const selectedUsers = reactive<string[]>([]);
const handleSelectedUser = (user: string) => {
	selectedUsers.push(user);
};
const handleConfirmSubmit = () => {
	visible.value = false;
	emit('selected', selectedUsers);
};
</script>

<style lang="scss" scoped></style>
